import {
    nodeResolve
} from '@rollup/plugin-node-resolve';
import terser from '@rollup/plugin-terser';

export default [
    // ES Module build
    {
        input: 'src/index.js',
        output: {
            file: 'dist/index.js',
            format: 'es'
        },
        plugins: [nodeResolve()]
    },
    // CommonJS build
    {
        input: 'src/index.js',
        output: {
            file: 'dist/index.cjs',
            format: 'cjs',
            exports: 'auto'
        },
        plugins: [nodeResolve()]
    },
    // UMD build for browsers
    {
        input: 'src/index.js',
        output: {
            file: 'dist/index.umd.js',
            format: 'umd',
            name: 'SomeFunUtils'
        },
        plugins: [nodeResolve()]
    },
    // Minified UMD build
    {
        input: 'src/index.js',
        output: {
            file: 'dist/index.umd.min.js',
            format: 'umd',
            name: 'SomeFunUtils'
        },
        plugins: [nodeResolve(), terser()]
    }
];